<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>相对定位</title>
    <style>
        .fu {
            background: #ff0;
        }

        .fu > div {
            width: 100px;
            height: 100px;
        }

        .z1 {
            background: red;
        }

        .z2 {
            background: green;
            /*使用相对定位*/
            position: relative;
            /*移动参照物：自己原来的位置*/
            top: 50px;
            right: 50px;
            /*调整的层级，数字越大，层级越往上靠*/
            z-index: 2;
        }

        .z3 {
            background: blue;
            /*使用相对定位*/
            position: relative;
            top: auto;
            z-index: 1;
        }
    </style>
</head>
<body>
<div class="fu">
    <div class="z1"></div>
    <div class="z2"></div>
    <div class="z3"></div>
</div>
</body>
</html>